<form class = "ajax-form" action = "{:url('')}" method="post">
    <div class = "form-group row">
        <label class = "col-sm-2 col-xs-12">父级节点{$vo.pid|default=''}</label>
        <div class = "col-sm-10 col-xs-12">
            <select class = "form-control" name="pid">
                <option value = "0" {if condition="isset($vo.pid) and $vo.pid eq 0"}selected{/if}>顶级节点</option>
                {foreach $nodes as $node}
                {if condition="$node.type eq 1"}
                <option value = "{$node.id}" {if condition="isset($vo.pid) and $vo.pid eq $node.id"}selected{/if}>{$node.name}</option>
                {notempty name="$node.sub"}
                    {foreach $node.sub as $twoNode}
                    {if condition="$twoNode.type eq 1"}
                <option value = "{$twoNode.id}" {if condition="isset($vo.pid) and $vo.pid eq $twoNode.id"}selected{/if}>&nbsp;&nbsp;|--{$twoNode.name}</option>
                    {notempty name="$twoNode.sub"}
                        {foreach $twoNode.sub as $thrdNode}
                        {if condition="$thrdNode.type eq 1"}
                        <option value = "{$thrdNode.id}" {if condition="isset($vo.pid) and $vo.pid eq $thrdNode.id"}selected{/if}>&nbsp;&nbsp;&nbsp;&nbsp;|--{$thrdNode.name}</option>
                        {/if}
                        {/foreach}
                    {/notempty}
                    {/if}
                    {/foreach}
                {/notempty}
                {/if}
                {/foreach}
            </select>
        </div>
    </div>
    <div class = "form-group row">
        <label class = "col-sm-2 col-xs-12">节点名称</label>
        <div class = "col-sm-10 col-xs-12">
            <input type="text" class = "form-control" name="name" placeholder="请填写节点名称" value="{$vo.name|default=''}"/>
        </div>
    </div>
    <div class = "form-group row">
        <label class = "col-sm-2 col-xs-12">节点链接</label>
        <div class = "col-sm-10 col-xs-12">
            <input type="text" class = "form-control" name="rule" placeholder="请填写节点链接" value="{$vo.rule|default=''}"/>
        </div>
    </div>
    <div class = "form-group row">
        <label class = "col-sm-2 col-xs-12">图标</label>
        <div class = "col-sm-10 col-xs-12">
            <input type="text" class = "form-control" name="icon" placeholder="请填写节点图标" value="{$vo.icon|default=''}"/>
        </div>
    </div>
    <div class = "form-group row">
        <label class = "col-sm-2 col-xs-12">节点类型</label>
        <div class = "col-sm-10 col-xs-12">
            <select class = "form-control" name="type">
                <option value = "1" {if condition="isset($vo.type) and $vo.type eq 1"}selected{/if}>菜单</option>
                <option value = "2" {if condition="isset($vo.type) and $vo.type eq 2"}selected{/if}>按钮</option>
                <option value = "3" {if condition="isset($vo.type) and $vo.type eq 3"}selected{/if}>接口</option>
            </select>
        </div>
    </div>
    <div class = "form-group row">
        <label class = "col-sm-2 col-xs-12">节点状态</label>
        <div class = "col-sm-10 col-xs-12">
            <select class = "form-control" name="status">
                <option value = "1" {if condition="isset($vo.status) and $vo.status eq 1"}selected{/if}>启用</option>
                <option value = "2" {if condition="isset($vo.status) and $vo.status eq 2"}selected{/if}>禁用</option>
            </select>
        </div>
    </div>
    <div class = "form-group row">
        <label class = "col-sm-2 col-xs-12">排序</label>
        <div class = "col-sm-10 col-xs-12">
            <input type="text" class = "form-control" name="sort" placeholder="请填写节点排序序号" value="{$vo.sort|default=''}"/>
        </div>
    </div>
    <div class = "form-group row">
        <label class = "col-sm-2 col-xs-12">备注</label>
        <div class = "col-sm-10 col-xs-12">
            <textarea name="remark" class = "form-control" placeholder="请填写节点备注">{$vo.remark|default=''}</textarea>
        </div>
    </div>
    {if isset($vo['id'])}<input type='hidden' value='{$vo.id}' name='id'>{/if}
    <div class = "form-group user-btn-group">

        <button class="btn btn-success" type='submit'>保存</button>
        <button class="btn btn-warning" type='button' data-confirm="确定要取消数据保存吗？" data-dismiss="modal">取消</button>
    </div>
</form>